package com.chinasofti.io;

import java.io.*;

public class Demo11 {
    public static void main(String[] args) throws IOException {
        BufferedWriter bw =
                new BufferedWriter(new FileWriter("java0419\\bw1.txt"));
        for (int i = 0; i < 10; i++) {
            bw.write("hello"+i);
            bw.newLine();
            bw.flush();
        }
        bw.close();
        BufferedReader br = new BufferedReader(new FileReader("java0419\\bw1.txt"));
        String line;
        while ((line = br.readLine())!= null){
            System.out.println(line);
        }
        br.close();
    }
}
